﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hi_Baidu.Packet
{
    public abstract class InPackage : Package
    {
        /// <summary>
        ///     验证包
        /// </summary>
        /// <returns>
        ///     默认返回true
        /// </returns>
        public override bool ValidataPackage()
        {
            return true;
        }

        /// <summary>
        ///     得到包名
        /// </summary>
        /// <returns>
        ///     默认返回未知包名
        /// </returns>
        public override string GetPackageName()
        {
            return "UnKownPackage";
        }

        /// <summary>
        ///     得到包体
        /// </summary>
        /// <returns>
        ///     返回包体
        /// </returns>
        public override Dictionary<String, byte[]> GetBody()
        {
            return this.Body;
        }
        /// <summary>
        ///      得到当前基础会话码
        /// </summary>
        /// <returns>返回基础会话码</returns>
        public virtual String GetSessionCode()
        {
            return Encoding.Default.GetString(this.Body["SESSIONCODE"]).Replace("*@^@*", "");
        }

        public abstract void InitPackage();
    }
}                                                                                                                                                                                                                                                                                                                                                